﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<SistemaBastanteo.Dominio.Representante>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Index
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Listado de Representante</h2>
    <form id = "frmSearch" action="/Representante/Search" method="post">
        Ruc de Cliente : <input type="text" name="Ruc" size="15" /> 
        <input type="submit" value="Buscar" />
    </form>
    <% if (ViewData["Codigo"] != null)
       { %>
    Codigo      : <%: ViewData["Codigo"]%>
    Ruc         : <%: ViewData["Ruc"]%>
    Razon Social: <%: ViewData["RazonSocial"]%>

    <table>
        <tr>
            <th></th>
            <th>
                Codigo
            </th>
            <th>
                Documento
            </th>
            <th>
                Nombres
            </th>
            <th>
                Apellidos
            </th>
            <th>
                Cargo
            </th>
            <th>
                Grupo
            </th>
        </tr>

    <% foreach (var item in Model) { %>
    
        <tr>
            <td>
                <%: Html.ActionLink("Edit", "Edit", new       { cliente = item.Cliente.Codigo , representante = item.Codigo }) %> |
                <%: Html.ActionLink("Details", "Details", new { cliente = item.Cliente.Codigo , representante = item.Codigo })%> |
                <%: Html.ActionLink("Delete", "Delete", new   { cliente = item.Cliente.Codigo , representante = item.Codigo })%>
            </td>
            <td>
                <%: item.Codigo %>
            </td>
            <td>
                <%: item.Documento %>
            </td>
            <td>
                <%: item.Nombres %>
            </td>
            <td>
                <%: item.Apellidos %>
            </td>
            <td>
                <%: item.Cargo %>
            </td>
            <td>
                <%: item.Grupo %>
            </td>
        </tr>
    
    <% } %>

    </table>
    
    <p>
        <%: Html.ActionLink("Nuevo Representante", "Create", "Representante", new { id = ViewData["Codigo"] }, null)%>
    </p>
    <%} %>

</asp:Content>

